package com.service;

import java.sql.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.dao.BranchDao;
import com.model.Branch;

@Service("branchService")
@Transactional
public class BranchServiceImpl implements BranchService{
	@Autowired
	private BranchDao branchDao;
	
	
	public void add(Branch branch) {
		branchDao.add(branch);		
	}

	public List<Branch> getAll() {
		return branchDao.getAll();
	}

	public Branch get(Integer id) {
		return branchDao.get(id);
	}

	public void delete(Integer id) {
		branchDao.delete(id);

	}

	public List<Branch> getByDate(Date from,Date to)
	{
		return branchDao.getByDate(from, to);
	}


	public List<Branch> getAll(int page) {
		return branchDao.getAll(page);

	}

	public int getNoOfRecords() {
		return branchDao.getNoOfRecords();
	}

	@SuppressWarnings("rawtypes")
	@Override
	public List getBranchName() {
		return branchDao.getBranchName();
	}

	@Override
	public Branch findByName(String branchName) {
		return branchDao.findByName(branchName);
	}

}
